﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Transactions;
using System.Runtime.Serialization;

using Unis.Framework.ORM.Attributes;
using Unis.Framework.RuleBase.Common;
using KingRoad.EPM.CompletionMaterialsEntity.Model;
using KingRoad.EPM.CompletionMaterialsDAL;
using System.Data;


namespace KingRoad.EPM.CompletionMaterialsDAL.BcdFileDataService
{    
    /// <summary> 
    /// 文件生成时间 2017/5/12 9:27:04
    /// </summary> 
    public class BcdFiledataService :BaseService<BcdFiledataInfo>, IBcdFiledataService
    {
        /// <summary>
        /// 根据父id获取子类型条数
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public int GetCountByFId(string id)
        {
            string strSql = "select Count(Fd_ID) as numb from dbo.Bcd_FileData where  ";
            if (id != null)
                strSql += "fd_pid='"+id+"'";
            else
                strSql += "fd_pid is null";
            DataTable dt = DatabaseExcuteBySql.QuerybySql(strSql);
            return Convert.ToInt32(dt.Rows[0][0]);
        }
    }

}

